/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package merlion.mrp.atpm.session;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import javax.ejb.Local;
import merlion.mrp.atpm.entity.PendingATP;
import merlion.mrp.ppm.entity.BackOrder;
import merlion.mrp.ppm.pojo.LongHolder;
import merlion.scm.lcm.entity.DeliveryOrder;

/**
 *
 * @author Zhang Ying
 */
@Local
public interface ATPSessionBeanLocal {

    public ArrayList<ArrayList<Long>> getDailyDemands(ArrayList<Timestamp> changedDates);

    public ArrayList<ArrayList<Long>> getDailyOTDemands(ArrayList<Timestamp> changedDates);

    public Collection<PendingATP> getPendingATPForRFQs();

    public Collection<PendingATP> getPendingATPForSos();

    public boolean confirmSimulationOfSalesOrder(ArrayList<ArrayList<LongHolder>> dailyDemands, ArrayList<ArrayList<LongHolder>> otDailyDemands, ArrayList<ArrayList<Long>> differences, ArrayList<Calendar> changedDates, PendingATP patp);

    public Timestamp simulateUrgentRfq(ArrayList<ArrayList<LongHolder>> dailyDemands, ArrayList<ArrayList<LongHolder>> otDailyDemands, ArrayList<ArrayList<Long>> differences,ArrayList<Calendar> changedDates, PendingATP patp);



    public Timestamp simulateSo(ArrayList<ArrayList<LongHolder>> dailyDemands, ArrayList<ArrayList<LongHolder>> otDailyDemands, ArrayList<ArrayList<Long>> differences, ArrayList<Calendar> changedDates, PendingATP patp);



    public String getIndicativeLeadTimeforUrgent(DeliveryOrder order, Timestamp requestedDate);

    public boolean checkIsWorkingDay(Calendar day);


    public Timestamp getIndicativeLeadTimeForRFQ(DeliveryOrder order);
    public boolean changeDOStatusAfterConfirmation(Long soId, Timestamp confirmedLT, Long deId);



    public String getConfirmedLeadTime(merlion.scm.lcm.entity.DeliveryOrder order, java.sql.Timestamp indicativeLT);

    public boolean changeSQIndicativeLeadTime(Long deoId, Timestamp indicativeLeadtime);

    //public boolean changeDOStatusAfterATPFailed(Long id);

    public ArrayList<BackOrder> getAllBackOrders();

    public boolean changeDOStatusAfterATPFailedRFQ(Long id);

    public boolean changeDOStatusAfterATPFailedSO(Long id);

    public void removePendingATP(PendingATP pendingATP);

    public boolean checkRawMaterial(ArrayList<ArrayList<Long>> differences, ArrayList<Calendar> dates);

    
}
